<?php
/**
 * Created by PhpStorm.
 * User: daojia
 * Date: 2020/5/8
 * Time: 14:48
 */
namespace app\common\library\wechat\payma;

use app\common\library\wechat\WxBase;
class Payma extends WxBase
{
    public function getUnlimited($page, $scene = ''){
        $accessToken = $this->getAccessToken();
        $url = 'https://api.weixin.qq.com/wxa/getwxacodeunlimit?access_token='.$accessToken;
        $data['page'] = $page;
        $data['scene'] = $scene;
        $data = json_encode($data);
        $result = $this->post($url, $data);
        $result=$this->data_uri($result,'image/png');
        return $result;
    }
    //二进制转图片image/png
    public function data_uri($contents, $mime)
    {
        $base64   = base64_encode($contents);
        return ('data:' . $mime . ';base64,' . $base64);
    }
}